package com.zdlee.netty.server20.client.handler;

import com.zdlee.netty.server20.protocol.response.GroupMessageResponsePacket;
import com.zdlee.netty.server20.session.Session;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author zdlee
 * @description: ${DESCRIPTION}
 * @create 2018-12-03 16:45
 */
public class GroupMessageResponseHandler extends SimpleChannelInboundHandler<GroupMessageResponsePacket> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, GroupMessageResponsePacket msg) throws Exception {
        String fromGroupId=msg.getFromGroupId();
        Session fromUser=msg.getFromUser();

        System.out.println("收到群[" + fromGroupId + "]中[" + fromUser + "]发来的消息：" + msg.getMessage());

    }
}
